package red.mlz.module.module.tag.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import red.mlz.module.module.tag.entity.MaterialsTagsRelation;
import red.mlz.module.module.tag.entity.Tag;

import java.math.BigInteger;
import java.util.List;

/**
 * <p>
 * 物料标签关系表 Mapper 接口
 * </p>
 *
 * @author mlzred
 * @since 2025-04-06
 */
public interface MaterialsTagsRelationMapper  {


    @Update("delete from materials_tags_relation  WHERE material_id = #{materialId}")
    int deleteByMaterialId(@Param("materialId") BigInteger materialId);


    @Select("SELECT * from materials_tags_relation WHERE material_id = #{materialId} and is_deleted = 0")
    List<MaterialsTagsRelation> listByMaterialId(@Param("materialId") BigInteger materialId);

    int insertBatch(@Param("materialsTagsRelationList") List<MaterialsTagsRelation> materialsTagsRelationList);
}
